let tableData = [
    {
        name: '小明',
        age: 12.,
        score:60,
    },
    {
        name: '小张',
        age: 15,
        score: 80,
    }
]

let table2 = [
    {
        age: 12,
        height:"170",
    },
    {
        age: 15,
        height: "168",
    },
    {
        age: 12,
        height: "179",
    }
]

tableData.forEach((item,index) => {
    table2.forEach((item1,index1) => {
        if (tableData[index].age == item.age) {
            tableData[index]["height"]=item1.height
        }
    })
})

console.log(tableData)
/**
 * [
    { name: '小明', age: 12, score: 60, test1: '179' },
    { name: '小张', age: 15, score: 80, test1: '179' }
  ]
 */